package activities;

import com.example.intellifit.R;
import com.example.intellifit.R.id;
import com.example.intellifit.R.layout;
import com.example.intellifit.R.menu;

import android.net.Uri;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;

public class Login extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_login);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.login_menu, menu);
		return true;
	}


	  @Override
	  public boolean onOptionsItemSelected(MenuItem item) {
	    switch (item.getItemId()) {
	      // Start the WebViewActivity to handle the authentication.
	      case R.id.login:
	        Intent intent = new Intent(this, WebViewActivity.class);
	        String YOUR_AUTHENTICATION_ENDPOINT = "http://www.weissreisen.at";
	        intent.setData(Uri.parse(YOUR_AUTHENTICATION_ENDPOINT));
	        startActivityForResult(intent, 0);
	        return true;
	      // Exit.
	      case R.id.exit:
	        finish();
	        return true;
	    }
	    return super.onOptionsItemSelected(item);
	  }

}
